<script setup lang="ts">
import { onBeforeRouteLeave } from 'vue-router'
const validate = () => {
  console.log('validate')
}
onBeforeRouteLeave((to, from) => {
  console.log('onBeforeRouteLeave:xxx')
})
defineExpose({ validate })
</script>

<template>
  <div class="test-page">test</div>
</template>

<style lang="scss" scoped></style>
